import request from '@/utils/request'
// 获取车辆列表
export const getCarListApi = (params) => {
  return request({
    url: '/truck/page',
    method: 'GET',
    params
  })
}
// 统计车辆
export const getCarNumApi = (params) => {
  return request({
    url: '/count',
    method: 'GET',
    params
  })
}
// 新增车辆
export const addCarApi = (data) => {
  return request({
    url: '/truck',
    method: 'POST',
    data
  })
}
// 车型选项
export const getOptions = (options) => {
  return request({
    url: '/truckType/simple',
    method: 'GET',
    options
  })
}
// 页数
export function getPage () {
  return request({
    url: '/count'
  })
}
// 获取车辆详情
export function getVehicleDetails (id) {
  return request({
    url: `/truck/${id}`
  })
}

/**
 * 分页查询回车登记列表
 */
export function getCarriageList (data) {
  return request({
    url: '/truck-return-register/pageQuery',
    method: 'POST',
    data
  })
}

// 更新图片
export function postImg (data) {
  console.log(data)
  return request({
    method: 'POST',
    url: '/files/imageUpload',
    data
  })
}
// 获取车辆类型信息列表
export function getTruckTypeApi () {
  return request({
    url: '/truckType/simple'
  })
}
